#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#include "Common.h"
#include "Window.h"
#include "Internals.h"
#include "CtrlClass.h"
#include "Assert.h"

int GUIAPI InitGUI()
{
    /*initialize default window process*/
    __lg_def_proc[0] = PreDefMainWinProc;
    __lg_def_proc[1] = PreDefControlProc;

    if(!InitGDI()) {
        Uart0_Printf("InitGUI: Initialization of GDI failure!\n");
        return -1;
    }

    if(!InitControlClass())
    {
        Uart0_Printf("InitGUI: Init Control Class failure!\n");
        return -1;
    }

    if (!InitDesktop ())
    {
        Uart0_Printf("InitGUI: Init Desktop failure!\n");
        return -1;
    }
    
    return 0;
}

void GUIAPI TerminateGUI ()
{
    TerminateDesktop();
    TerminateControlClass();
    TerminateGDI();
}

